package com.itheima.collection;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo1 {
    public static void main(String[] args) {
        Collection<String> coll = new ArrayList<>();
        coll.add("龟田大郎");
        coll.add("龟田次郎");
        coll.add("龟田太郎");

        int size = coll.size();
        System.out.println("size = " + size);

        coll.removeIf(s->s.equals("龟田大郎"));
        System.out.println(coll);

        boolean empty = coll.isEmpty();
        System.out.println("empty = " + empty);

        coll.removeIf(s->s.contains("太"));
        System.out.println(coll);

        coll.clear();
        System.out.println(coll);
    }
}
